<%@ page language="java" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="css/form.css" type=text/css rel=stylesheet>
<script type="text/javascript" src="js/jquery/jquery.1.4.4.min.js"></script>
<script type="text/javascript" src="js/jquery/jquery.input.check.js"></script>
<script type="text/javascript" src="js/jquery/jquery.validate.js"></script>
<script type="text/javascript" src="js/jquery/jquery.form.js"></script>
<title>学生</title>
<script>
$(document).ready(function() {
   var validator = $("#form").validate({
      rules: {
         "name": {
            required:true,
         },
         "age": {
            required:true,
            numberDE:true
         },
         "addr": {
            required:true
         }
      },
      messages: {
         "name": {
            required: "必须输入姓名",
         },
         "age": {
            required: "必须输入年龄",
            numberDE: "年龄必须为整数"
         },
         "addr": {
            required: "必须输入家庭住址",
         }
      }     
   });
   
	$("#form").ajaxForm({
		timeout:5000000,
		cache:false,
		async:false,
		success: function(data) {
			closeWindow();
			parent.loadGrid();
	   }
	});
	
})
   
function closeWindow(){
	$("#cboxClose", window.parent.document).click();
}
</script>
</head>
<body style="background-color: #f2fcfc">
修改学生
<form action="/user/save" method="post" id="form">
<input type="hidden" name="id" value="${student.id}">
<div class="div">
	<label class="label">姓名：</label> 
	<input type="text" name="name"  minlength="2" maxlength="10" value="${student.name}">
</div>
<div class="div">
	<label class="label">年龄：</label> 
	<input type="text" name="age" value="${student.age}">
</div>

<div class="div">
	<label class="label">班级：</label> 
	<su:grade name="grade.gradeId" value="${student.grade.gradeId}"></su:grade>
</div>

<label class="label">家庭住址：</label> 
<textarea name="addr" class="textarea"  minlength="2" maxlength="40">${student.addr}</textarea>


<div style="width: 200px;margin-top: 5px">	
	<input type="submit" value="提交">
	<input type="button" value="关闭" onclick="closeWindow()">
</div>
</form>
</body>
</html>